package com.world.cat.model.back;

import com.world.common.generate.auto.Action;
import com.world.common.generate.auto.QField;
import com.world.common.generate.auto.QFieldQueryType;
import com.world.common.model.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by gang on 2017/3/12.
 */
//操作日志
@Entity
@Table(name = "sys_handle_log")
public class HandleLog extends BaseEntity {
    @Column(name = "obj_id", nullable = false)
    @QField(name = "对象id", actions = {Action.edit, Action.query, Action.show}, queryType = QFieldQueryType.like, nullable = false)
    private String objId;//对象id

    @Column(name = "title", nullable = false)
    @QField(name = "标题", actions = {Action.edit, Action.query, Action.show}, queryType = QFieldQueryType.like, nullable = false)
    private String title;//标题

    @Column(name = "action", nullable = false)
    @QField(name = "动作", actions = {Action.edit, Action.query, Action.show}, queryType = QFieldQueryType.like, nullable = false)
    private String action;//动作

    @Column(name = "content", columnDefinition = "text", nullable = false)
    @QField(name = "处理内容", actions = {Action.edit, Action.query, Action.show}, queryType = QFieldQueryType.like, nullable = false)
    private String content;//内容

    @Column(name = "remark", columnDefinition = "text", nullable = false)
    @QField(name = "备注", actions = {Action.edit, Action.query, Action.show}, queryType = QFieldQueryType.like)
    private String remark;//备注

    public HandleLog() {

    }

    public HandleLog(String objId, String title, String action, String content, String remark) {
        this.objId = objId;
        this.title = title;
        this.action = action;
        this.content = content;
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Transient
    private List<String> files = new ArrayList<>();

    public List<String> getFiles() {
        return files;
    }

    public void setFiles(List<String> files) {
        this.files = files;
    }

    public String getObjId() {
        return objId;
    }

    public void setObjId(String objId) {
        this.objId = objId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
